package com.learn.factory;

public class CarFactory {

    public static Car createCar(String brand) {
        Car car = null;
        switch (brand) {
            case "maserati": // 玛莎拉蒂
                car = new MaseratiCar(brand);
                break;
            case "bmw": // 宝马
                car = new BMWCar(brand);
                break;
        }
        return car;
    }
}
